This forum is closed to new posts and
responses. The content has been migrated to the Digital Solutions Community. Please join us there for new content as well as this content. For customer support, please visit the official HCL customer support channels below:
Subject: LS2J using Java Library with Notes Java Classes
Feedback Type: Problem
Product Area: Domino Designer on Eclipse (DDE)
Technical Area: Application Development
Platform: Windows
Release: 8.5.2
Reproducible: Always
I have created a Java Library through the Designer client and am attempting to use LS2J to access it. The LotusScript part is correct and seems to work fine, it is the Java Library itself which is throwing an error.
Here is the LotusScript code snippet:
Dim jSession As JavaSession
Dim jClass As JavaClass
Dim jObj As JavaObject
...
Set jSession = New JavaSession()
Set jClass = jSession.GetClass("globalSpreadsheet")
Set jObj = jClass.CreateObject
returnText = jObj.validateSpreadsheet(fileName)
Here is the Java code snippet:
import lotus.domino.*;
import java.io.*;
import java.util.*;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
public class globalSpreadsheet extends AgentBase {
Session s;
AgentContext agentContext;
Database db;
Document doc;
Document docKey;
View viewKey;
String searchKey;
String keywordValue;
String templateVersion;
String currentTemplate;
String output;
int sepPos;
int checkRow;
short checkColumn;
InputStream input = null;
// Constants...
String delimiter = "~~";
public String validateSpreadsheet(String detachFilePath) {
try {
// Get the Notes objects...
System.out.println("START");
s = getSession();
I cannot get the "START" to appear in the Java Console. I just get this error:
java.lang.NullPointerException
at globalSpreadsheet.validateSpreadsheet(globalSpreadsheet.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at lotus.domino.JavaConnectInvoker.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at lotus.domino.JavaConnectLoader.invoke(Unknown Source)